import { expect } from 'chai';
import { splitByHanziNum } from '../src/splitByHanziNum';

describe('splitByHanziNum unit test', function() {
    it('should work for even string', function() {
        expect(splitByHanziNum("一二三四", 2)).to.eql(["一二", "三四"]);
    });

    it('should work for odd string', function() {
        expect(splitByHanziNum("一二三四五", 2)).to.eql(["一二", "三四", "五"]);
    });

    it('should work for odd hanzi and ascii', function() {
        expect(splitByHanziNum("一ab二三", 2)).to.eql(["一ab", "二三"]);
    });

    it('should work for odd hanzi and ascii', function() {
        expect(splitByHanziNum("一a二三", 2)).to.eql(["一a", "二三"]);
    });
});
